home *** CD-ROM | disk | FTP | other *** search
- /*FTPGadReq V2.10
- A simple utility to run GadMget, and then request the selected files
- using DaFTP.
-
- **** REQUIRES REQREXXTOOLS.LIBRARY, GadMGet, & GZip ****
- **** Available on Aminet****
-
- FTPGadReq is an Arrex script which filters the output from GadMGet, and
- then gets the selected file using AmiFTP or DaFTP. When run,
- it will display a requester with 5 options
-
- RECENT.Z ---- GET RECENT.Z from your Aminet host, and extract it
-
- RECENT ---- GET RECENT from your host
-
- OLD ---- use the local RECENT file
-
- INDEX ---- use the local INDEX file
-
- REUSE ---- use the output from the last run of FTPGadReq. (if using
- the CLIP: device, this may have been overwritten)
-
-
- GadMget will then run, using the selected file as source.
- When files have been selected, and GadMget quit, AmiFTP will then get these
- files for you.
-
- When the file has been received, the description for it in Recent or Index
- will be added as a file note.
-
- The variables below must be set correctly, and gzip must be in your path
- for all options to work.
-
- This script is freeware, do with it as you will.
-
- Peter Hanrahan (peterh@fl.net.au)
- */
-
- /*trace results*/
-
-
- /*Variables*/
- client = 'AMIFTP' /*AMIFTP or DAFTP */
- GadPath = 'AMITCP:GadMget' /*Path to GadMget*/
- Recent='DH3:DL/RECENT' /*Path to your RECENT file*/
- Index='DH3:Internet/Index' /*Path to your INDEX file*/
- GadOut = 'CLIP:' /*Path to GadMget's output file*/
- scre = 'Workbench' /*Screen for AmiFTP*/
- downl='DL:' /*Download path*/
-
- /*end of variables**/
-
- IF ~SHOW(l,"rexxreqtools.library") THEN
- IF ~ADDLIB("rexxreqtools.library", 0, -30, 0) THEN
- EXIT 10
-
- /*Select Get source*/
- source = rtezrequest("Get Source", "RECENT.Z|RECENT|OLD|INDEX|REUSE","GadMget","rt_pubscrname="||scre)
-
- if upper(client)='AMIFTP' then address 'AMIFTP'
-
- if upper(client)='DAFTP' then address 'daftp'
-
- if source = 1 then do
-
- get 'RECENT.Z'
-
- address command 'gzip -df dl:RECENT.Z'
-
- end
-
- if source = 2 then do
-
- get 'RECENT'
-
- end
-
- if source = 4 then recent = index
-
- if source> 0 then do
-
- call open(gado,gadout,w)
- call writech(gado,'0a'x)
- call close(gado)
- address command gadpath' 'recent 'OUTPUT 'GadOut' KEEPBLANKLINES NOSIMPLEPATHS NOPARSE PUBSCREEN '||scre
-
- end
-
-
-
- call open(clip,GadOut,r)
- stem = 1
- call sep
- do while ~eof(clip)
- call sep
- end
- if stem < 2 then exit
- call close(clip)
- call open(CON,'con:0/400/-1/112/FTP_Request/SCREEN 'scre,'W')
- mes = 'Selected 'stem-1' File'
- if stem >2 then mes =mes||'s'
- call writeln(con,mes)
- do count = 1 to stem-1
- call writeln(con,fil.count)
- end
- call writeln(con,'')
-
- do count = 1 to stem-1
- fnam= substr(fil.count,lastpos('/',fil.count)+1)
- call writeln(con,'Requesting 'left(fnam,max(20,length(fnam)+1),' ')siz.count' 'desc.count)
- get fil.count
- if exists(downl||fnam) then address command 'filenote 'downl||fnam' '||'22'x||desc.count||'22'x
- end
- exit
-
- sep:
- lis = readln(clip)
- if eof(clip) then return
- if length(lis) > 2 then lis = left(lis,length(lis)-1)
- w = words(lis)
- if w < 2 then return
- fil.stem = word(lis,2)'/'word(lis,1)
- siz.stem=substr(lis,30,5)
- desc.stem = substr(lis,36)
- stem = stem + 1
- return
-